<?php
  include_once('../class_timer.php');
  require_once('./config.php');
  require_once('./tool_benchmark.php');

  $a = array();
  for($i=0;$i<$nb_iter;++$i){
    $a[] = rand(0,2);
  }

  function work1($_a){
    $c = count($_a);
    $j = 0;
    for($i=0;$i<$c;++$i){
      if($_a[$i] == 1) ++$j;  
    }
  }

  function work2($_a){
    $c = count($_a);
    $j = 0;
    for($i=0;$i<$c;++$i){
      if($_a[$i] === 1) ++$j;  
    }
  }

  $time1 = new Timer();

  $array_functions = array('work1', 'work2');
  Tool_benchmark::bench_array_functions($array_functions,$a,$nb_experiences,$time1);
  $array_names = array('==', '===');
  Tool_benchmark::print_info_bench($array_names,$time1);

//print "https://chart.googleapis.com/chart?chxt=x,y&cht=bvs&chd=t:$res[0],$res[1]&chco=76A4FB&chls=2.0&chs=200x125&chxl=0:|eq|eqq";
?>
